import { createRouter, createWebHistory } from 'vue-router'
import layout from '../views/layout.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: layout,
      redirect: '/home',
      children: [
        {
          path: '/home',
          name: 'home',
          component: () => import('../views/home.vue')
        },
        {
          path: '/about',
          name: 'about',
          component: () => import('../views/about.vue')
        },
        {
          path: '/aboutApp',
          name: 'aboutApp',
          component: () => import('../views/aboutApp.vue')
        },
        {
          path: '/translate',
          name: 'translate',
          component: () => import('../views/translate.vue')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login.vue')
    }
  ]
})

export default router
